package cc.mcggdd.leah.boot.stock.service;

import cc.mcggdd.leah.boot.stock.model.entity.StockBill;
import cc.mcggdd.leah.boot.stock.model.form.StockBillForm;
import cc.mcggdd.leah.boot.stock.model.query.StockBillQuery;
import cc.mcggdd.leah.boot.stock.model.vo.StockBillVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;

/**
 * 账单服务类
 *
 * @author 
 * @since 2025-02-10 14:57
 */
public interface StockBillService extends IService<StockBill> {

    /**
     *账单分页列表
     *
     * @return
     */
    IPage<StockBillVO> getStockBillPage(StockBillQuery queryParams);

    /**
     * 获取账单表单数据
     *
     * @param id 账单ID
     * @return
     */
     StockBillForm getStockBillFormData(Long id);

    /**
     * 新增账单
     *
     * @param formData 账单表单对象
     * @return
     */
    boolean saveStockBill(StockBillForm formData);

    /**
     * 修改账单
     *
     * @param id   账单ID
     * @param formData 账单表单对象
     * @return
     */
    boolean updateStockBill(Long id, StockBillForm formData);

    /**
     * 删除账单
     *
     * @param ids 账单ID，多个以英文逗号(,)分割
     * @return
     */
    boolean deleteStockBills(String ids);

    /**
     * 获取账单总金额
     * @param debtId
     * @param status
     * @return
     */
    BigDecimal getStockTotalAmount(Long debtId, String status);

    LocalDate getRepayMaxDate();

    List<StockBill> getAllRecord(String n);
}
